import { BasicColumn } from "/@/components/Table"
import { FormSchema } from "/@/components/Table"
import { rules } from "/@/utils/helper/validator"
import { render } from "/@/utils/common/renderUtils"

export const columns: BasicColumn[] = [
  {
    title: "ID",
    dataIndex: "id",
    width: 150,
  },
  {
    title: "图标",
    dataIndex: "logo",
    width: 80,
    customRender: ({ text }) => {
      return render.renderAvatar(text || "/@/assets/images/default-app.png")
    },
  },

  {
    title: "应用名",
    dataIndex: "name",
    width: 150,
  },
  {
    title: "说明",
    dataIndex: "remark",
    width: 150,
    customRender: ({ text }) => {
      return text ? text : '-'
    },
  },
  {
    title: "创建时间",
    dataIndex: "createdAt",
    width: 150,
  }
]

export const searchFormSchema: FormSchema[] = [
  {
    label: "名称",
    field: "name",
    component: "Input",
  }
]
